﻿using Microsoft.Office.Tools.Ribbon;
using MingleReport;

namespace MingleReportingExcelAddIn
{
    public partial class RibbonControls : OfficeRibbon
    {
        public RibbonControls()
        {
            InitializeComponent();
            ProjectsMenu.Enabled = ImportDataButton.Enabled = false;
        }

        private void Ribbon1_Load(object sender, RibbonUIEventArgs e)
        {
        }

        private void ImportDataButtonClick(object sender, RibbonControlEventArgs e)
        {
            new MingleReportingForm(MingleSession).Show();
        }

        private void LoginButtonClick(object sender, RibbonControlEventArgs e)
        {
            new LoginForm(MingleSession).Show();
            ProjectsMenu.Enabled = ImportDataButton.Enabled = true;
        }


        public IMingleSession MingleSession
        {
            get { return new MingleSession(Globals.ThisAddIn.Application); }
        }
    }
}